From: Dave Jones Date: Tue, 10 Sep 2013 21:04:25 +0000 (-0400) Subject: Add missing unlocks to error paths of mountpoint_last. X-Git-Tag: archive/raspbian/4.9.13-1+rpi1~10^2~8016^2^2~36 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=da5338c7498556b760871661ffecb053cc6f708f;p=linux-4.9.git Add missing unlocks to error paths of mountpoint_last. Signed-off-by: Dave Jones Signed-off-by: Al Viro --- diff --git a/fs/namei.c b/fs/namei.c index 841c8d9286c0..0dc4cbf21f37 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2261,12 +2261,15 @@ mountpoint_last(struct nameidata *nd, struct path *path) dentry = d_alloc(dir, &nd->last); if (!dentry) { error = -ENOMEM; + mutex_unlock(&dir->d_inode->i_mutex); goto out; } dentry = lookup_real(dir->d_inode, dentry, nd->flags); error = PTR_ERR(dentry); - if (IS_ERR(dentry)) + if (IS_ERR(dentry)) { + mutex_unlock(&dir->d_inode->i_mutex); goto out; + } } mutex_unlock(&dir->d_inode->i_mutex);